//--------------------------------------------------------------------------------
// This file is a portion of the D2D1Renderer.  It is distributed
// under the MIT License, available in the root of this distribution and 
// at the following URL:
//
// http://www.opensource.org/licenses/mit-license.php
//
// Copyright (c) Mirco Timmermann
//
//--------------------------------------------------------------------------------
#pragma once

#include <d2d1.h>

class Path {

public:
	Path(ID2D1Factory* d2dFactory);
	~Path(void);

	void Clear();

	void Begin();

	void Add(float x, float y);
	void AddBezier(float x1, float y1, float x2, float y2, float x3, float y3);
	void AddQuadraticBezier(float x1, float y1, float x2, float y2);
	void AddArc(double x, double y, double radius, double startAngle, double endAngle, bool anticlockwise = true);

	void close();
	void end();

	void Move(float x, float y);

	ID2D1PathGeometry* GetGeometry();

protected:
	ID2D1Factory* _d2dFactory;

	ID2D1PathGeometry* _geometry;
	ID2D1GeometrySink* _sink;

private:
	bool _begin;

};